package com.ojoin.trade.supplyloan_core.web.service;

import com.ojoin.trade.common.exception.BusinessException;
import com.ojoin.trade.common.web.service.BaseService;
import com.ojoin.trade.supplyloan_core.web.domain.SlLoanNotPaybackVo;
import com.ojoin.trade.supplyloan_core.web.domain.TbSlLoanDailyBillVo;
import com.ojoin.trade.supplyloan_core.web.domain.TbSlLoanInfo;
import com.ojoin.trade.supplyloan_core.web.domain.TbSlLoanInfoVo;
import org.springframework.data.domain.Pageable;

import java.util.List;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * User: Administrator
 * Date: 15-10-27
 * Time: 上午11:38
 * To change this template use File | Settings | File Templates.
 */
public interface TbSlLoanInfoService extends BaseService<TbSlLoanInfo> {

//    /**
//     *新增一条供应商的贷款情况信息
//     * @param idOfTbMerchantUser
//     * @param totalLoanAmount
//     * @param totalPayBackAmount
//     * @param totalInterestRate
//     * @param totalNotPaybackAmount
//     * @param totalNotPaybackRate
//     * @throws BusinessException
//     */
//    public void addTbSlLoanInfo(int idOfTbMerchantUser,String totalLoanAmount,String totalPayBackAmount,String totalInterestRate,String totalNotPaybackAmount,String totalNotPaybackRate)throws BusinessException;

      public void insertTbSlLoanInfo(TbSlLoanInfo infovo)throws  BusinessException;
    /**
     *更新供应商的贷款情况信息
     * @param paramsmap
     * @throws BusinessException
     */
    public int updateTbSlLoanInfo(Map<String,Object> paramsmap)throws BusinessException;

    /**
     *根据join的主键和平台pint查询贷款情况
     * @param joinid
     * @return
     * @throws BusinessException
     */

    public TbSlLoanInfo  queryTbSlLoanInfoByJoinid(int joinid)throws BusinessException;


    public TbSlLoanInfo queryLoanInfoByJoinid(int joinid)throws BusinessException;

    /**
     *查询所有商户的贷款信息
     * @return
     * @throws BusinessException
     */
    public List<TbSlLoanInfoVo> queryAllTbSlLoanInfo()throws BusinessException;


    /**
     * 商户的贷款情况总表计息
     */
    public void updateCaculateFee()throws BusinessException;

    public long queryTotalNotPayback(int idOfTbMerchantUser)throws BusinessException;

    /**
     * 查询商户各个平台贷款情况
     * @param idOfTbMerchantUser
     * @return
     * @throws BusinessException
     */
    public List<SlLoanNotPaybackVo> queryPlatformLoanInfoByJoinid(int idOfTbMerchantUser) throws BusinessException;


    public void lockId(int id)throws BusinessException;

    public void lockTable()throws BusinessException;

    public void updateForCopyLoanInfo()throws BusinessException;

    public List<TbSlLoanDailyBillVo> queryDailyBill(String curdate,Integer idOfTbMerchantUser,Integer idOfTbMerchantUserOfCreditor,Pageable pageable) throws BusinessException;

    public String queryDailySum(String curdate, Integer idOfTbMerchantUser,Integer idOfTbMerchantUserOfCreditor) throws BusinessException ;
}